package cn.zn.job.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 定时任务调度日志表
 * </p>
 *
 * @author zn-admin
 * @since 2021-01-29
 */
@TableName("SYS_JOB_LOG")
public class SysJobLog extends Model<SysJobLog> {

    private String id;

    @TableField("JOB_ID")
    private String jobId;

    /**
     * 任务名称
     */
    @TableField("JOB_NAME")
    private String jobName;

    /**
     * 任务组名
     */
    @TableField("JOB_GROUP")
    private String jobGroup;

    /**
     * 调用目标字符串
     */
    @TableField("INVOKE_TARGET")
    private String invokeTarget;

    /**
     * 日志信息
     */
    @TableField("JOB_MESSAGE")
    private String jobMessage;

    /**
     * 执行状态（0正常 1失败）
     */
    @TableField("STATUS")
    private String status;

    /**
     * 异常信息
     */
    @TableField("EXCEPTION_INFO")
    private String exceptionInfo;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    protected Date createTime;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getJobId() {
        return jobId;
    }

    public void setJobId(String jobId) {
        this.jobId = jobId;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getJobGroup() {
        return jobGroup;
    }

    public void setJobGroup(String jobGroup) {
        this.jobGroup = jobGroup;
    }

    public String getInvokeTarget() {
        return invokeTarget;
    }

    public void setInvokeTarget(String invokeTarget) {
        this.invokeTarget = invokeTarget;
    }

    public String getJobMessage() {
        return jobMessage;
    }

    public void setJobMessage(String jobMessage) {
        this.jobMessage = jobMessage;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getExceptionInfo() {
        return exceptionInfo;
    }

    public void setExceptionInfo(String exceptionInfo) {
        this.exceptionInfo = exceptionInfo;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "SysJobLog{" +
                "jobName=" + jobName +
                ", jobGroup=" + jobGroup +
                ", invokeTarget=" + invokeTarget +
                ", jobMessage=" + jobMessage +
                ", status=" + status +
                ", exceptionInfo=" + exceptionInfo +
                "}";
    }
}
